package com.ch.base.taglib;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.log4j.Logger;

public class PaginationTrTag extends TagSupport{
	private final Logger log = Logger.getLogger(this.getClass());

	private String targetObjId;
	private int row;
	private String title="";
	private String align= "left";
	private String valign= "top";
	private String style = "";
	private String styleClass = ""; 
	private String onclick = "";
	private String ondblclick = "";
	private String onmousedown = "";
	private String onmousemove = "";
	private String onmouseout = "";
	private String onmouseover = "";
	private String onmouseup = "";


	public int doStartTag() throws JspException{
		JspWriter out = pageContext.getOut();
		try{
			out.println("<tr id=\"tr_" + targetObjId + "_" + row + "\" name=\"tr_" + targetObjId + "\" ");
			out.println("title=\"" + title + "\" ");
			out.println("align = \"" + align + "\" ");
			out.println("valign = \"" + valign + "\" ");
			out.println("style = \"" + style + "\" ");
			out.println("class = \"" + styleClass + "\" ");
			out.println("onclick = \"" + onclick + "\" ");
			out.println("ondblclick = \"" + ondblclick + "\" ");
			out.println("onmousedown = \"" + onmousedown + "\" ");
			out.println("onmousemove = \"" + onmousemove + "\" ");
			out.println("onmouseout = \"" + onmouseout + "\" ");
			out.println("onmouseover = \"" + onmouseover + "\" ");
			out.println("onmouseup = \"" + onmouseup + "\" ");
			out.println("> ");
		}catch(Exception ex){
			throw new JspException(ex);
		}
		return EVAL_BODY_INCLUDE;
	}

	public int doEndTag() throws JspException {
		JspWriter out = pageContext.getOut();
		try{
			out.println("</tr>");
		}catch(Exception ex){
			throw new JspException(ex);
		}
		this.release();
		return EVAL_PAGE;
	}

	public String getTargetObjId() {
		return targetObjId;
	}

	public void setTargetObjId(String targetObjId) {
		this.targetObjId = targetObjId;
	}

	public int getRow() {
		return row;
	}

	public void setRow(int row) {
		this.row = row;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAlign() {
		return align;
	}

	public void setAlign(String align) {
		this.align = align;
	}

	public String getValign() {
		return valign;
	}

	public void setValign(String valign) {
		this.valign = valign;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public String getStyleClass() {
		return styleClass;
	}

	public void setStyleClass(String styleClass) {
		this.styleClass = styleClass;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}

	public String getOndblclick() {
		return ondblclick;
	}

	public void setOndblclick(String ondblclick) {
		this.ondblclick = ondblclick;
	}

	public String getOnmousedown() {
		return onmousedown;
	}

	public void setOnmousedown(String onmousedown) {
		this.onmousedown = onmousedown;
	}

	public String getOnmousemove() {
		return onmousemove;
	}

	public void setOnmousemove(String onmousemove) {
		this.onmousemove = onmousemove;
	}

	public String getOnmouseout() {
		return onmouseout;
	}

	public void setOnmouseout(String onmouseout) {
		this.onmouseout = onmouseout;
	}

	public String getOnmouseover() {
		return onmouseover;
	}

	public void setOnmouseover(String onmouseover) {
		this.onmouseover = onmouseover;
	}

	public String getOnmouseup() {
		return onmouseup;
	}

	public void setOnmouseup(String onmouseup) {
		this.onmouseup = onmouseup;
	}

	public Logger getLog() {
		return log;
	}

}
